<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>checkIP</title>
    <script src="webjars/jquery/3.6.0/jquery.min.js"></script>
</head>
<style>
    table {
        border-spacing: 0px;
        margin: 10% auto;
    }

    td {
        border: 1px solid black;
        width: 100px;
        height: 30px;
        text-align: center;
    }
</style>
<body>
<table>
    <caption><h1>IP计数结果</h1></caption>
    <tr>
        <td>IP编号</td>
        <td>IP地址</td>
        <td>出现次数</td>
    </tr>
</table>
</body>
<script>
    $.post(
        "CheckIP",
        function (resp) {
            var i = 0;
            for (var key in resp) {
                $("table").append(
                    "<tr>" +
                    "<td>" + i++ + "</td>" +
                    "<td>" + key + "</td>" +
                    "<td>" + resp[key] + "</td>" +
                    "</tr>"
                );
            }
        },
        "json"
    );
</script>
</html>